<template>
  <div id="scenicSpot">
    <div class="content">
      <el-card>
        <div class="title"><h2>人气景点</h2></div>
        <div class="list">
          <Item
            :item="item"
            @click="togo('./detail?id=' + item.id)"
            v-for="item in data"
            :key="item"
          />
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import Item from "@/components/Item.vue";
import { useRouter } from "vue-router";
import { ref, reactive } from "vue";

const data = reactive([
  {
    id: 1,
    img: require("@/assets/img/jingdian/jd01.jpg"),
    title: "黄山+宏村3日2晚跟团游",
    price: 1299,
  },
  {
    id: 2,
    img: require("@/assets/img/jingdian/jd02.jpg"),
    title: "浙江普陀山+洛迦山4日3晚跟团游",
    price: 970,
  },
  {
    id: 3,
    img: require("@/assets/img/jingdian/jd03.jpg"),
    title: "乌镇+苏州+南京3日2晚跟团游",
    price: 1066,
  },
  {
    id: 4,
    img: require("@/assets/img/jingdian/jd04.jpg"),
    title: "苏州+普陀山+千岛湖4日3晚跟团游",
    price: 1587,
  },
]);

const router = useRouter();
const togo = (path) => {
  router.push(path);
};
</script>

<style lang="scss" scoped>
#scenicSpot {
  margin-top: 30px;
  ::v-deep .el-card {
    width: 100%;
  }
  .title {
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #e3e3e3;
    margin-bottom: 20px;
  }
  .list {
    display: flex;
    justify-content: space-between;
  }
}
</style>
